<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>生产企业管理</title>
<meta name="decorator" content="default"/>
<script src="${ctxStatic}/common/change/change.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	initVaccCompanyName(bsCompany.code,bsCompany.name);
	$(document).on("click","#btnReset",function(){
		$("#code").val("").select2();
		$("#doIf").val("");
	})
});
var bsCompany = JSON.parse('${fns:toJson(bsCompany)}');
function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	$("#searchForm").submit();
    return false;
}
function down(){
	top.$.jBox.confirm("确认要导出疫苗厂商数据吗？","系统提示",function(v,h,f){
		if(v=="ok"){
			$("#searchForm").attr("action","${ctx}/company/bsCompany/export");
			$("#searchForm").submit();
		}
		$("#searchForm").attr("action","${ctx}/company/bsCompany/form");
	},{buttonsFocus:1});
	top.$('.jbox-body .jbox-icon').css('top','55px');
}
</script>
<style type="text/css">
	.minWidth {
		min-width: 177px;
	}	
	#contentTable td ,#contentTable th{
		text-align: center;
		padding: 1px 25px;
	}
</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/company/bsCompany/">疫苗厂商列表</a></li>
		<shiro:hasPermission name="company:bsCompany:edit"><li><a href="${ctx}/company/bsCompany/form">疫苗厂商<shiro:hasPermission name="company:bsCompany:edit">${not empty bsCompany.id?'修改':'添加'}</shiro:hasPermission></a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="bsCompany" action="${ctx}/company/bsCompany/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div class="breadcrumb">
			<table class="table table-bordered">
				<tr>
				    <th>疫苗厂商:</th>
					<td>
						<form:select path="code" id="code" class="span2 minWidth vaccCompanyName">
						</form:select>
					</td>
					<th>是否可用：</th>
					<td>
						<form:radiobuttons path="doIf" items="${fns:getDictList('bs_vaccinate_status')}"
					        itemLabel="label" itemValue="value" class="required" />
					</td>
				</tr>
			</table>
		</div>
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		<input id="btnReset" type="button" class="btn btn-primary" value="重置"/>
		<input onclick="down()" class="btn btn-primary" type="button" value="导出"/>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>疫苗厂商</th>
				<th>疫苗厂商全称</th>
				<th>疫苗厂商编码</th>
				<th>是否可用</th>
				<shiro:hasPermission name="company:bsCompany:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="bsCompany" begin="0" varStatus="status">
			<tr data-id="${bsCompany.id}">
				<td>
					${(page.pageNo-1)*page.pageSize+status.index+1}
                </td>
                <td>
					${bsCompany.name}
                </td>
				<td>
					${bsCompany.nameAll}
				</td>
				<td>
					${bsCompany.code}
				</td>
				<td>
					${fns:getDictLabel(bsCompany.doIf, 'bs_vaccinate_status', '') }
				</td>
				<shiro:hasPermission name="company:bsCompany:edit"><td>
    				<a href="${ctx}/company/bsCompany/form?id=${bsCompany.id}">修改</a>
					<a href="${ctx}/company/bsCompany/delete?id=${bsCompany.id}" onclick="return confirmx('确认要删除该生产企业吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>